<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/door/door.js"></script>
		<title>读取门控制参数</title>
	</head>
	<body>
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<div  class="toolbar-panel ">
				<div class="toolbar-box">
					<div class="toolbar-head clearfix">
						<!-- 顶部按钮 -->
						<div class="buttons"> 		
							<!-- <a href="javascript:void(0);" class="btn btn-primary fa" id="checkParam"  onclick ="checkParam();" ><span>门控制参数</span></a> -->
						</div>
						<!-- 收缩 -->
						<div class="tools">
							<a href="javascript:void(0);" class="collapse">
								<i class="bigger-180 fa  fa-angle-double-up"></i>
							</a>
						</div>
					</div>
					<!-- #查询条件-->
					<div class="toolbar-body" >
						<form role="form" class="search-form">
							<div  class="form-inline p-xxs">
								<div class="form-group">
									<label   class="search-label">控制器序列号</label>:
									<input type="text"  name="sn"  id="sn" class="form-control"  value='${sn}' />
								</div> 
								
								<div class="form-group">
									<label   class="search-label">UID 号</label>:
									<input type="text"  name="card"  id="card" class="form-control" value='${card}' />
								</div> 
								<div class="form-group">
									<label   class="search-label">1号门</label>:
									<input type="text"  name="door1"  id="door1" class="form-control"  />
								</div> 
								
								<div class="form-group">
									<label   class="search-label">2号门</label>:
								<input type="text"  name="door2"  id="door2" class="form-control"  />
								</div> 
								<div class="form-group">
									<label   class="search-label">3号门</label>:
									<input type="text"  name="door3"  id="door3" class="form-control"  />
								</div> 
								<div class="form-group">
									<label   class="search-label">4号门</label>:
									<input type="text"  name="door4"  id="door4" class="form-control"  />
								</div> 
								<div class="form-group">
									<label   class="search-label">开始时间</label>:
									<input type="text"  name="starttime"  id="starttime" class="form-control"  />
								</div> 
								
									<div class="form-group">
									<label   class="search-label">结束时间</label>:
									<input type="text"  name="endtime"  id="endtime" class="form-control"  />
								</div> 
								
								
							</div> 
						</form>
					</div><!--/ 查询条件-->
				</div>
			</div><!--/ 操作、查询-->
			
		</div>
	<script type="text/javascript">
	
	//alert("开始执行");
	$(document).ready(function(){
  	  // 在这里写你的代码...
  	// alert("自动加载");
  	 checkParam1();
  	 function checkParam1(){	
		 //获取显示的记录
		    //发送ajax请求
		     //alert("在线查询权限");
         	 //获取参数
         	 sn=$("#sn").val();
         	card=$("#card").val();
         
         //	alert("sn="+sn+"card="+card);
         	
         	// _ctx="http://192.168.0.190:8025";
         	 _ctx="${address}";
         	// alert("url="+_ctx);
         	//调用接口获取在线查询权限
         	  $.ajax({
		    	         	type: "GET",
		    	         	   url: _ctx+"/getCardPermiss?sn="+sn+"&card="+card,
		    	         	  async: false,//使用同步操作，否则init方法执行时setting可能还未被赋值
		    	         	  success: function(data) {
		    	         		//  alert("方法执行");
		    	         		  console.log(data);
		    	         		 var myJSON = JSON.stringify(data);
		    	         		//  alert(myJSON);
		    	         		    if(data.code==200){
		    	         		        
		    	         		    	
		    	         		    	//赋值
		    	         		    	$("#sn").val(data.sn);
		    	         		    	$("#card").val(data.recordCardNO);
		    	         		    //	alert("value="+data.door1);
		    	         		    	$("#door1").val(data.door1);
		    	         		    	$("#door2").val(data.door2);
		    	         		    	$("#door3").val(data.door3);
		    	         		   	    $("#door4").val(data.door4); 
		    	         		    	// alert("读取门控制参数成功！");
		    	         		    	var time=data.recordTime;
		    	         		    	if(time!=null){
		    	         		    		timelist=time.trim().split(" ");
		    	         		    	}
		    	         		   	   $("#starttime").val(timelist[0]);
		    	         		   	   $("#endtime").val(timelist[1]);
		    	         		    }else{
		    	         		    	alert("在线查询权限异常！");
		    	         		    }
		    	         	        
		    	         	 },
		    	         	 error: function(){
		    	         		  alert("在线查询权限失败！");
		    	              }
		    	         	 
		    	         	 });  
		    	         	 //end
        
		    	         	 
		    	         	 
		    	         	 
 }//function end
	
	
	});

	
	
	
	
	</script>
	</body>
	
</html>